Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) Display all items on ui-select-extended #440

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ODORA0
Copy link
Member

@ODORA0 ODORA0 commented Dec 4, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

  • Updated shouldFilterItem to always return true, ensuring all items are displayed when the caret is clicked.
  • Adjusted tests to validate that all items remain visible even after typing input.

Screenshots

Screen.Recording.2024-12-04.at.22.07.33.mov

Related Issue

https://openmrs.atlassian.net/browse/O3-3911

Other

@samuelmale
Copy link
Member

Can you update your branch to pick up the fix for the failing CI build?

@ODORA0 ODORA0 requested a review from samuelmale December 5, 2024 04:49
@samuelmale
Copy link
Member

@ODORA0 is it possible to fix the issue without getting rid the filter?

@ODORA0
Copy link
Member Author

ODORA0 commented Dec 9, 2024

@samuelmale The filtering restricts options because the shouldFilterItem function dynamically excludes items that don’t match the current inputValue. If the logic doesn’t explicitly account for an empty inputValue (e.g. when the caret is clicked), only the currently selected item or no items may be displayed, as the filter prevents non-matching items from appearing.

@denniskigen
Copy link
Member

Thanks, @ODORA0. How different is this than getting rid of the prop altogether? AFAICT, the filtering behaviour of the ComboBox input where only the matching item is listed when the dropdown is clicked after selecting an item is by design. See the underlying useComboBox hook implementation for the Downshift library here. I think it's preferable to just remove the prop altogether until the underlying behavior changes upstream from Carbon.

@ODORA0
Copy link
Member Author

ODORA0 commented Dec 11, 2024

@denniskigen I agree, change made

@samuelmale
Copy link
Member

Ping @denniskigen

@denniskigen
Copy link
Member

denniskigen commented Dec 18, 2024

Good to go for me, @samuelmale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants